home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 406_01 / disked25 / source / dirent.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-13  |  2.2 KB  |  114 lines

  1. /***
  2. *dirent.h - struct/function declarations for directory handling
  3. *
  4. *  Copyright (c) 1993-1994, Gregg Jennings.  All wrongs reserved.
  5. *
  6. *Purpose:
  7. *  This include file contains the function declarations and structure
  8. *  declarations for the functions related to directory handling.
  9. *
  10. ****/
  11.  
  12. /*
  13.    Versions:
  14.  
  15.    1.1  13-Nov-1993  DosTime and DosDate entries were backward.
  16.                      Attribute is as well but I havent used it yet,
  17.                      there may be alignment problems with it as well.
  18.    1.0  June 1993
  19. */
  20.  
  21. #ifndef GENERAL_H
  22. #include "general.h"
  23. #endif
  24.  
  25. #ifndef _DIR_DEFINED
  26.  
  27. #pragma pack(1)
  28.  
  29. typedef struct file_attributes {
  30.    unsigned rdonly:1;
  31.    unsigned hidden:1;
  32.    unsigned system:1;
  33.    unsigned volume:1;
  34.    unsigned subdir:1;
  35.    unsigned archiv:1;
  36.    unsigned unused:2;
  37.    unsigned reserved:8;                /* must align as word */
  38. } Attribute;
  39.  
  40. typedef struct file_time {
  41.    unsigned seconds:5;
  42.    unsigned minutes:6;
  43.    unsigned hours:5;
  44. } DosTime;
  45.  
  46. typedef struct file_date {
  47.    unsigned day:5;
  48.    unsigned month:4;
  49.    unsigned year:7;
  50. } DosDate;
  51.  
  52. struct DIR {
  53.    byte name[8];
  54.    byte ext[3];
  55.    Attribute attr;
  56.    byte reserved[9];    /* NOTE: reserved byte held by Attribute */
  57.    DosTime time;
  58.    DosDate date;
  59.    word start;
  60.    dword size;
  61. };
  62.  
  63. struct xDIR {
  64.    byte ff;
  65.    byte reserved0[5];
  66.    byte a;
  67.    byte d;
  68.    byte name[8];
  69.    byte ext[3];
  70.    Attribute attr;
  71.    byte reserved[9];    /* NOTE: reserved byte held by Attribute */
  72.    DosTime time;
  73.    DosDate date;
  74.    word start;
  75.    dword size;
  76. };
  77.  
  78. struct FCB {
  79.    byte drive;
  80.    byte name[8];
  81.    byte ext[3];
  82.    word blkno;
  83.    word recsz;
  84.    dword size;
  85.    word date;
  86.    word time;
  87.    byte reserved[8];
  88.    byte recno;
  89.    dword recnum;
  90. };
  91.  
  92. struct xFCB {
  93.    byte ff;
  94.    byte reserved1[5];
  95.    byte a;
  96.    byte drive;
  97.    byte name[8];
  98.    byte ext[3];
  99.    word blkno;
  100.    word recsz;
  101.    dword size;
  102.    word date;
  103.    word time;
  104.    byte reserved[8];
  105.    byte recno;
  106.    dword recnum;
  107. };
  108.  
  109. #define _DIR_DEFINED
  110. #endif
  111.  
  112. extern int changedir(unsigned char *buf,int sec_size);
  113. extern void dumpdir(unsigned char *buf,int sec_size);
  114.